home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -seriously_amiga- / programming / mui / mcc_settingswindow / sources / settingswindow_mcc.s < prev    next >
Text File  |  1999-02-08  |  3KB  |  219 lines

  1.     BOPT    uo+
  2.  
  3. *************************************
  4. * IDString, Name, Version der Library
  5.  
  6. IDSTRING    macro
  7.         dc.b    "SettingsWindow.mcc 1.00 (19.07.98) ©1997 Ingo Weinhold",0
  8.     endm
  9.  
  10. LIBNAME    macro
  11.         dc.b    "SettingsWindow.mcc",0
  12.     endm
  13.  
  14. Version    equ    0
  15. Revision    equ    40
  16. Pri        equ    0
  17. *************************************
  18.  
  19.  
  20.  
  21.     INCDIR    "tool:Barfly/include_i/"
  22.     INCLUDE    "exec/types.i"
  23.     INCLUDE    "exec/initializers.i"
  24.     INCLUDE    "exec/libraries.i"
  25.     INCLUDE    "exec/lists.i"
  26.     INCLUDE    "exec/nodes.i"
  27.     INCLUDE    "exec/resident.i"
  28.     INCLUDE    "exec/alerts.i"
  29.     INCLUDE    "libraries/dos.i"
  30.  
  31. CALLSYS    macro
  32.         jsr _LVO\1(a6)
  33.     endm
  34.  
  35. XLIB        macro
  36.         XREF    _LVO\1
  37.     endm
  38.  
  39.  
  40.     STRUCTURE    MyLib,LIB_SIZE
  41.         ULONG    ml_SysLib
  42. *        ULONG    ml_DosLib
  43.         ULONG    ml_SegList
  44.         UBYTE    ml_Flags
  45.         UBYTE    ml_pad
  46.         LABEL    MyLib_Sizeof
  47.  
  48.  
  49.     XLIB    OpenLibrary
  50.     XLIB    CloseLibrary
  51.     XLIB    FreeMem
  52.     XLIB    Remove
  53.     XLIB    Alert
  54.  
  55.  
  56.  
  57. Start:
  58.     moveq        #0,d0
  59.     rts
  60.  
  61.  
  62.  
  63. Resident:
  64.     dc.w    RTC_MATCHWORD
  65.     dc.l    Resident
  66.     dc.l    CodeEnde
  67.     dc.b    RTF_AUTOINIT
  68.     dc.b    Version
  69.     dc.b    NT_LIBRARY
  70.     dc.b    Pri
  71.     dc.l    LibName
  72.     dc.l    IDString
  73.     dc.l    Init
  74.  
  75. LibName:        LIBNAME
  76.  
  77. IDString:    dc.b "$VER: "
  78.                 IDSTRING
  79.                 ds.w    0
  80.  
  81.  
  82. Init:
  83.     dc.l    MyLib_Sizeof
  84.     dc.l    FuncTable
  85.     dc.l    DataTable
  86.     dc.l    InitRoutine
  87.  
  88.  
  89. FuncTable:
  90. ;    Sys-Routinen
  91.  
  92.     dc.l    Open
  93.     dc.l    Close
  94.     dc.l    Expunge
  95.     dc.l    Null
  96.  
  97. ;    eigene Routinen
  98.  
  99.     dc.l    MCC_GetClass
  100.     dc.l    -1
  101.  
  102.  
  103.  
  104. DataTable:
  105.     INITBYTE    LH_TYPE,NT_LIBRARY
  106.     INITLONG    LN_NAME,LibName
  107.     INITBYTE    LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
  108.     INITWORD    LIB_VERSION,Version
  109.     INITWORD    LIB_REVISION,Revision
  110.     INITLONG    LIB_IDSTRING,IDString
  111.     dc.l    0
  112.  
  113.  
  114. ;>= D0 = Zeiger auf Lib-Struktur
  115. ;>= A0 = Zeiger auf SegList der Library
  116. ;>= A6 = ExecBase
  117.  
  118. ;=> D0 = Zeiger auf Lib-Struktur
  119.  
  120. InitRoutine:
  121.     move.l    a5,-(a7)
  122.     move.l    d0,a5
  123.     move.l    a6,ml_SysLib(a5)
  124.     move.l    a0,ml_SegList(a5)
  125.  
  126.     XREF        _MCC_Init
  127.  
  128.     move.l    a5,a6
  129.     jsr        _MCC_Init
  130.     tst.l        d0
  131.     bne.s        2$
  132.  
  133.     move.l    a5,d0
  134.     bra.s        1$
  135. 2$:
  136.     clr.l        d0
  137. 1$:
  138.     move.l    ml_SysLib(a5),a6
  139.     move.l    (a7)+,a5
  140.     rts
  141.  
  142.  
  143. ;>= A6 = Zeiger auf Lib-Struktur
  144.  
  145. ;>= D0 = Zeiger auf Lib-Struktur
  146.  
  147.  
  148. Open:
  149.     addq.w    #1,LIB_OPENCNT(a6)
  150.     bclr        #LIBB_DELEXP,ml_Flags(a6)
  151.     move.l    a6,d0
  152.     rts
  153.  
  154.  
  155. Close:
  156.     clr.l        d0
  157.     subq.w    #1,LIB_OPENCNT(a6)
  158.     bne.s        1$
  159.     btst        #LIBB_DELEXP,ml_Flags(a6)
  160.     beq.s        1$
  161.     bsr        Expunge
  162. 1$:
  163.     rts
  164.  
  165.  
  166. ;>= A6 = Zeiger auf Library
  167.  
  168. ;=> D0 = Zeiger auf SegList der Library
  169.  
  170. Expunge:
  171.     movem.l    d2/a5-a6,-(a7)
  172.     move.l    a6,a5
  173.     tst.w        LIB_OPENCNT(a5)
  174.     beq.s        1$
  175.     bset        #LIBB_DELEXP,ml_Flags(a5)
  176.     clr.l        d0
  177.     bra.s        Expunge_end
  178.  
  179. 1$:
  180.     XREF        _MCC_Cleanup
  181.     jsr        _MCC_Cleanup
  182.  
  183.     move.l    ml_SysLib(a5),a6
  184.     move.l    ml_SegList(a5),d2
  185.     move.l    a5,a1
  186.     CALLSYS    Remove
  187.  
  188. *    move.l    ml_DosLib(a5),a1
  189. *    CALLSYS    CloseLibrary
  190.     clr.l        d0
  191.     move.l    a5,a1
  192.     move.w    LIB_NEGSIZE(a5),d0
  193.     sub.l        d0,a1
  194.     add.w        LIB_POSSIZE(a5),d0
  195.     CALLSYS    FreeMem
  196.     move.l    d2,d0
  197.  
  198. Expunge_end:
  199.     movem.l    (a7)+,d2/a5-a6
  200.     rts
  201.  
  202.  
  203. Null:
  204.     moveq        #0,d0
  205.     rts
  206.  
  207.  
  208.  
  209.     XREF        _MCC_GetClass
  210. MCC_GetClass:
  211.     jsr        _MCC_GetClass
  212.     rts
  213.  
  214.  
  215. CodeEnde:
  216.  
  217.     END
  218.  
  219.